package com.example.multilevelapprovalback.service.impl;

import com.example.multilevelapprovalback.mapper.UserMapper;
import com.example.multilevelapprovalback.pojo.User;
import com.example.multilevelapprovalback.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    /**
     * 用户登录
     * @param user
     * @return
     */
    @Override
    public User login(User user) {
        return userMapper.getByNameAndPassword(user);
    }
    /**
     * 查询所有用户
     * @return
     */
    @Override
    public Object getAllUser() {
        List<User> list = userMapper.getAllUser();
        return list;
    }
}
